/*********************************************************************
	Rhapsody	: 7.6
	Login		: Pawel
	Component	: DefaultComponent
	Configuration 	: DefaultConfig
	Model Element	: InnerDoor
//!	Generated Date	: Sun, 27, Nov 2011 
	File Path	: DefaultComponent/DefaultConfig/CargoLiftSystem/InnerDoor.java
*********************************************************************/

package CargoLiftSystem;

//## auto_generated
import java.util.*;
//## link itsIDoorsLock 
import Hardware.IDoorsLock;
//## auto_generated
import com.ibm.rational.rhapsody.oxf.*;
//## auto_generated
import com.ibm.rational.rhapsody.animation.*;
//## auto_generated
import com.ibm.rational.rhapsody.oxf.states.*;
//## auto_generated
import com.ibm.rational.rhapsody.animcom.animMessages.*;

//----------------------------------------------------------------------------
// CargoLiftSystem/InnerDoor.java                                                                  
//----------------------------------------------------------------------------

//## package CargoLiftSystem 


//## class InnerDoor 
public class InnerDoor implements RiJStateConcept, Animated {
    
    //#[ ignore
    // Instrumentation attributes (Animation)
    private Animate animate;
    
    public static AnimClass animClassInnerDoor = new AnimClass("CargoLiftSystem.InnerDoor",false);
    //#]
    
    public Reactive reactive;		//## ignore 
    
    protected int doorsOpenTime = 1000;		//## attribute doorsOpenTime 
    
    protected IDoorsLock itsIDoorsLock;		//## link itsIDoorsLock 
    
    protected Lift itsLift;		//## link itsLift 
    
    protected LinkedList<OuterDoor> itsOuterDoor;		//## link itsOuterDoor 
    
    //#[ ignore 
    public static final int RiJNonState=0;
    public static final int InnerDoorActive=1;
    public static final int readyToClose=2;
    public static final int lockingDoors=3;
    public static final int doorsUnlocked=4;
    public static final int doorsOpened=5;
    public static final int doorsLocked=6;
    public static final int doorsClosed=7;
    public static final int closingDoors=8;
    //#]
    protected int rootState_subState;		//## ignore 
    
    protected int rootState_active;		//## ignore 
    
    protected int InnerDoorActive_subState;		//## ignore 
    
    public static final int InnerDoor_Timeout_readyToClose_id = 1;		//## ignore 
    
    
    //## statechart_method 
    public RiJThread getThread() {
        return reactive.getThread();
    }
    
    //## statechart_method 
    public void schedTimeout(long delay, long tmID, RiJStateReactive reactive) {
        getThread().schedTimeout(delay, tmID, reactive);
    }
    
    //## statechart_method 
    public void unschedTimeout(long tmID, RiJStateReactive reactive) {
        getThread().unschedTimeout(tmID, reactive);
    }
    
    //## statechart_method 
    public boolean isIn(int state) {
        return reactive.isIn(state);
    }
    
    //## statechart_method 
    public boolean isCompleted(int state) {
        return reactive.isCompleted(state);
    }
    
    //## statechart_method 
    public RiJEventConsumer getEventConsumer() {
        return (RiJEventConsumer)reactive;
    }
    
    //## statechart_method 
    public void gen(RiJEvent event) {
        reactive._gen(event);
    }
    
    //## statechart_method 
    public void queueEvent(RiJEvent event) {
        reactive.queueEvent(event);
    }
    
    //## statechart_method 
    public int takeEvent(RiJEvent event) {
        return reactive.takeEvent(event);
    }
    
    // Constructors
    
    //## auto_generated 
    public  InnerDoor(RiJThread p_thread) {
        try {
            animInstance().notifyConstructorEntered(animClassInnerDoor.getUserClass(),
               new ArgData[] {
               });
        
        reactive = new Reactive(p_thread);
        {
            itsOuterDoor = new LinkedList<OuterDoor>();
        }
        }
        finally {
            animInstance().notifyMethodExit();
        }
        
    }
    
    //## auto_generated 
    public int getDoorsOpenTime() {
        return doorsOpenTime;
    }
    
    //## auto_generated 
    public void setDoorsOpenTime(int p_doorsOpenTime) {
        doorsOpenTime = p_doorsOpenTime;
    }
    
    //## auto_generated 
    public IDoorsLock getItsIDoorsLock() {
        return itsIDoorsLock;
    }
    
    //## auto_generated 
    public void setItsIDoorsLock(IDoorsLock p_IDoorsLock) {
        itsIDoorsLock = p_IDoorsLock;
        if(p_IDoorsLock != null)
            {
                animInstance().notifyRelationAdded("itsIDoorsLock", p_IDoorsLock);
            }
        else
            {
                animInstance().notifyRelationCleared("itsIDoorsLock");
            }
    }
    
    //## auto_generated 
    public Lift getItsLift() {
        return itsLift;
    }
    
    //## auto_generated 
    public void __setItsLift(Lift p_Lift) {
        itsLift = p_Lift;
        if(p_Lift != null)
            {
                animInstance().notifyRelationAdded("itsLift", p_Lift);
            }
        else
            {
                animInstance().notifyRelationCleared("itsLift");
            }
    }
    
    //## auto_generated 
    public void _setItsLift(Lift p_Lift) {
        if(itsLift != null)
            {
                itsLift.__setItsInnerDoor(null);
            }
        __setItsLift(p_Lift);
    }
    
    //## auto_generated 
    public void setItsLift(Lift p_Lift) {
        if(p_Lift != null)
            {
                p_Lift._setItsInnerDoor(this);
            }
        _setItsLift(p_Lift);
    }
    
    //## auto_generated 
    public void _clearItsLift() {
        animInstance().notifyRelationCleared("itsLift");
        itsLift = null;
    }
    
    //## auto_generated 
    public ListIterator<OuterDoor> getItsOuterDoor() {
        ListIterator<OuterDoor> iter = itsOuterDoor.listIterator();
        return iter;
    }
    
    //## auto_generated 
    public void _addItsOuterDoor(OuterDoor p_OuterDoor) {
        if(p_OuterDoor != null)
            {
                animInstance().notifyRelationAdded("itsOuterDoor", p_OuterDoor);
            }
        else
            {
                animInstance().notifyRelationCleared("itsOuterDoor");
            }
        itsOuterDoor.add(p_OuterDoor);
    }
    
    //## auto_generated 
    public OuterDoor newItsOuterDoor() {
        OuterDoor newOuterDoor = new OuterDoor(getThread());
        newOuterDoor._setItsInnerDoor(this);
        itsOuterDoor.add(newOuterDoor);
        animInstance().notifyRelationAdded("itsOuterDoor", newOuterDoor);
        return newOuterDoor;
    }
    
    //## auto_generated 
    public void _removeItsOuterDoor(OuterDoor p_OuterDoor) {
        animInstance().notifyRelationRemoved("itsOuterDoor", p_OuterDoor);
        itsOuterDoor.remove(p_OuterDoor);
    }
    
    //## auto_generated 
    public void deleteItsOuterDoor(OuterDoor p_OuterDoor) {
        p_OuterDoor._setItsInnerDoor(null);
        itsOuterDoor.remove(p_OuterDoor);
        animInstance().notifyRelationRemoved("itsOuterDoor", p_OuterDoor);
        p_OuterDoor=null;
    }
    
    //## auto_generated 
    public boolean startBehavior() {
        boolean done = true;
        {
            ListIterator<OuterDoor> iter = itsOuterDoor.listIterator();
            while (iter.hasNext()){
                done &= (itsOuterDoor.get(iter.nextIndex())).startBehavior();
                iter.next();
            }
        }
        done &= reactive.startBehavior();
        return done;
    }
    
    //## ignore 
    public class Reactive extends RiJStateReactive implements AnimatedReactive {
        
        // Default constructor 
        public Reactive() {
            this(RiJMainThread.instance());
        }
        
        
        // Constructors
        
        public  Reactive(RiJThread p_thread) {
            super(p_thread);
            initStatechart();
        }
        
        //## statechart_method 
        public boolean isIn(int state) {
            if(InnerDoorActive_subState == state)
                {
                    return true;
                }
            if(rootState_subState == state)
                {
                    return true;
                }
            return false;
        }
        
        //## statechart_method 
        public boolean isCompleted(int state) {
            return true;
        }
        
        //## statechart_method 
        public void rootState_add(AnimStates animStates) {
            animStates.add("ROOT");
            if(rootState_subState == InnerDoorActive)
                {
                    InnerDoorActive_add(animStates);
                }
        }
        
        //## statechart_method 
        public void rootState_entDef() {
            {
                rootState_enter();
                rootStateEntDef();
            }
        }
        
        //## statechart_method 
        public int rootState_dispatchEvent(short id) {
            int res = RiJStateReactive.TAKE_EVENT_NOT_CONSUMED;
            switch (rootState_active) {
                case doorsClosed:
                {
                    res = doorsClosed_takeEvent(id);
                }
                break;
                case doorsOpened:
                {
                    res = doorsOpened_takeEvent(id);
                }
                break;
                case closingDoors:
                {
                    res = closingDoors_takeEvent(id);
                }
                break;
                case doorsLocked:
                {
                    res = doorsLocked_takeEvent(id);
                }
                break;
                case doorsUnlocked:
                {
                    res = doorsUnlocked_takeEvent(id);
                }
                break;
                case readyToClose:
                {
                    res = readyToClose_takeEvent(id);
                }
                break;
                case lockingDoors:
                {
                    res = lockingDoors_takeEvent(id);
                }
                break;
                default:
                    break;
            }
            return res;
        }
        
        //## statechart_method 
        public void InnerDoorActive_add(AnimStates animStates) {
            animStates.add("ROOT.InnerDoorActive");
            switch (InnerDoorActive_subState) {
                case doorsClosed:
                {
                    doorsClosed_add(animStates);
                }
                break;
                case doorsOpened:
                {
                    doorsOpened_add(animStates);
                }
                break;
                case closingDoors:
                {
                    closingDoors_add(animStates);
                }
                break;
                case doorsLocked:
                {
                    doorsLocked_add(animStates);
                }
                break;
                case doorsUnlocked:
                {
                    doorsUnlocked_add(animStates);
                }
                break;
                case readyToClose:
                {
                    readyToClose_add(animStates);
                }
                break;
                case lockingDoors:
                {
                    lockingDoors_add(animStates);
                }
                break;
                default:
                    break;
            }
        }
        
        //## statechart_method 
        public void readyToClose_add(AnimStates animStates) {
            animStates.add("ROOT.InnerDoorActive.readyToClose");
        }
        
        //## statechart_method 
        public void lockingDoors_add(AnimStates animStates) {
            animStates.add("ROOT.InnerDoorActive.lockingDoors");
        }
        
        //## statechart_method 
        public void doorsUnlocked_add(AnimStates animStates) {
            animStates.add("ROOT.InnerDoorActive.doorsUnlocked");
        }
        
        //## statechart_method 
        public void doorsOpened_add(AnimStates animStates) {
            animStates.add("ROOT.InnerDoorActive.doorsOpened");
        }
        
        //## statechart_method 
        public void doorsLocked_add(AnimStates animStates) {
            animStates.add("ROOT.InnerDoorActive.doorsLocked");
        }
        
        //## statechart_method 
        public void doorsClosed_add(AnimStates animStates) {
            animStates.add("ROOT.InnerDoorActive.doorsClosed");
        }
        
        //## statechart_method 
        public void closingDoors_add(AnimStates animStates) {
            animStates.add("ROOT.InnerDoorActive.closingDoors");
        }
        
        //## auto_generated 
        protected void initStatechart() {
            rootState_subState = RiJNonState;
            rootState_active = RiJNonState;
            InnerDoorActive_subState = RiJNonState;
        }
        
        //## statechart_method 
        public void doorsClosed_enter() {
            animInstance().notifyStateEntered("ROOT.InnerDoorActive.doorsClosed");
            InnerDoorActive_subState = doorsClosed;
            rootState_active = doorsClosed;
            doorsClosedEnter();
        }
        
        //## statechart_method 
        public void doorsUnlockedExit() {
        }
        
        //## statechart_method 
        public void lockingDoors_exit() {
            popNullConfig();
            lockingDoorsExit();
            animInstance().notifyStateExited("ROOT.InnerDoorActive.lockingDoors");
        }
        
        //## statechart_method 
        public void readyToClose_exit() {
            readyToCloseExit();
            animInstance().notifyStateExited("ROOT.InnerDoorActive.readyToClose");
        }
        
        //## statechart_method 
        public void doorsLocked_exit() {
            doorsLockedExit();
            animInstance().notifyStateExited("ROOT.InnerDoorActive.doorsLocked");
        }
        
        //## statechart_method 
        public void doorsOpened_exit() {
            popNullConfig();
            doorsOpenedExit();
            animInstance().notifyStateExited("ROOT.InnerDoorActive.doorsOpened");
        }
        
        //## statechart_method 
        public void doorsOpened_enter() {
            animInstance().notifyStateEntered("ROOT.InnerDoorActive.doorsOpened");
            pushNullConfig();
            InnerDoorActive_subState = doorsOpened;
            rootState_active = doorsOpened;
            doorsOpenedEnter();
        }
        
        //## statechart_method 
        public void doorsOpened_entDef() {
            doorsOpened_enter();
        }
        
        //## statechart_method 
        public int doorsUnlockedTakeevDoorsOpen() {
            int res = RiJStateReactive.TAKE_EVENT_NOT_CONSUMED;
            animInstance().notifyTransitionStarted("3");
            doorsUnlocked_exit();
            doorsOpened_entDef();
            animInstance().notifyTransitionEnded("3");
            res = RiJStateReactive.TAKE_EVENT_COMPLETE;
            return res;
        }
        
        //## statechart_method 
        public void closingDoors_entDef() {
            closingDoors_enter();
        }
        
        //## statechart_method 
        public int doorsClosed_takeEvent(short id) {
            int res = RiJStateReactive.TAKE_EVENT_NOT_CONSUMED;
            if(event.isTypeOf(evOpenDoors.evOpenDoors_CargoLiftSystem_id))
                {
                    res = doorsClosedTakeevOpenDoors();
                }
            
            if(res == RiJStateReactive.TAKE_EVENT_NOT_CONSUMED)
                {
                    res = InnerDoorActive_takeEvent(id);
                }
            return res;
        }
        
        //## statechart_method 
        public void doorsClosed_entDef() {
            doorsClosed_enter();
        }
        
        //## statechart_method 
        public void doorsUnlocked_entDef() {
            doorsUnlocked_enter();
        }
        
        //## statechart_method 
        public void readyToClose_enter() {
            animInstance().notifyStateEntered("ROOT.InnerDoorActive.readyToClose");
            InnerDoorActive_subState = readyToClose;
            rootState_active = readyToClose;
            readyToCloseEnter();
        }
        
        //## statechart_method 
        public void InnerDoorActive_entDef() {
            InnerDoorActive_enter();
            
            animInstance().notifyTransitionStarted("0");
            doorsClosed_entDef();
            animInstance().notifyTransitionEnded("0");
        }
        
        //## statechart_method 
        public void lockingDoorsExit() {
        }
        
        //## statechart_method 
        public void lockingDoors_enter() {
            animInstance().notifyStateEntered("ROOT.InnerDoorActive.lockingDoors");
            pushNullConfig();
            InnerDoorActive_subState = lockingDoors;
            rootState_active = lockingDoors;
            lockingDoorsEnter();
        }
        
        //## statechart_method 
        public int readyToCloseTakeevObstacleInDoors() {
            int res = RiJStateReactive.TAKE_EVENT_NOT_CONSUMED;
            animInstance().notifyTransitionStarted("6");
            readyToClose_exit();
            doorsOpened_entDef();
            animInstance().notifyTransitionEnded("6");
            res = RiJStateReactive.TAKE_EVENT_COMPLETE;
            return res;
        }
        
        //## statechart_method 
        public void readyToClose_entDef() {
            readyToClose_enter();
        }
        
        //## statechart_method 
        public void closingDoors_enter() {
            animInstance().notifyStateEntered("ROOT.InnerDoorActive.closingDoors");
            InnerDoorActive_subState = closingDoors;
            rootState_active = closingDoors;
            closingDoorsEnter();
        }
        
        //## statechart_method 
        public void doorsLockedExit() {
        }
        
        //## statechart_method 
        public void doorsUnlockedEnter() {
        }
        
        //## statechart_method 
        public void InnerDoorActiveExit() {
        }
        
        //## statechart_method 
        public int rootState_takeEvent(short id) {
            int res = RiJStateReactive.TAKE_EVENT_NOT_CONSUMED;
            return res;
        }
        
        //## statechart_method 
        public void closingDoorsEnter() {
        }
        
        //## statechart_method 
        public void doorsClosedEnter() {
        }
        
        //## statechart_method 
        public void lockingDoors_entDef() {
            lockingDoors_enter();
        }
        
        //## statechart_method 
        public void rootState_enter() {
            animInstance().notifyStateEntered("ROOT");
            rootStateEnter();
        }
        
        //## statechart_method 
        public void rootStateEnter() {
        }
        
        //## statechart_method 
        public void doorsUnlocked_exit() {
            doorsUnlockedExit();
            animInstance().notifyStateExited("ROOT.InnerDoorActive.doorsUnlocked");
        }
        
        //## statechart_method 
        public int readyToCloseTakeevLiftOverloaded() {
            int res = RiJStateReactive.TAKE_EVENT_NOT_CONSUMED;
            animInstance().notifyTransitionStarted("5");
            readyToClose_exit();
            doorsOpened_entDef();
            animInstance().notifyTransitionEnded("5");
            res = RiJStateReactive.TAKE_EVENT_COMPLETE;
            return res;
        }
        
        //## statechart_method 
        public void closingDoors_exit() {
            closingDoorsExit();
            animInstance().notifyStateExited("ROOT.InnerDoorActive.closingDoors");
        }
        
        //## statechart_method 
        public void doorsClosed_exit() {
            doorsClosedExit();
            animInstance().notifyStateExited("ROOT.InnerDoorActive.doorsClosed");
        }
        
        //## statechart_method 
        public int doorsLocked_takeEvent(short id) {
            int res = RiJStateReactive.TAKE_EVENT_NOT_CONSUMED;
            if(event.isTypeOf(evDoorsUnlocked.evDoorsUnlocked_CargoLiftSystem_id))
                {
                    res = doorsLockedTakeevDoorsUnlocked();
                }
            
            if(res == RiJStateReactive.TAKE_EVENT_NOT_CONSUMED)
                {
                    res = InnerDoorActive_takeEvent(id);
                }
            return res;
        }
        
        //## statechart_method 
        public int readyToClose_takeEvent(short id) {
            int res = RiJStateReactive.TAKE_EVENT_NOT_CONSUMED;
            if(event.isTypeOf(evObstacleInDoors.evObstacleInDoors_CargoLiftSystem_id))
                {
                    res = readyToCloseTakeevObstacleInDoors();
                }
            else if(event.isTypeOf(RiJEvent.TIMEOUT_EVENT_ID))
                {
                    res = readyToCloseTakeRiJTimeout();
                }
            else if(event.isTypeOf(evLiftOverloaded.evLiftOverloaded_CargoLiftSystem_id))
                {
                    res = readyToCloseTakeevLiftOverloaded();
                }
            
            if(res == RiJStateReactive.TAKE_EVENT_NOT_CONSUMED)
                {
                    res = InnerDoorActive_takeEvent(id);
                }
            return res;
        }
        
        //## statechart_method 
        public void InnerDoorActive_enter() {
            animInstance().notifyStateEntered("ROOT.InnerDoorActive");
            rootState_subState = InnerDoorActive;
            InnerDoorActiveEnter();
        }
        
        //## statechart_method 
        public int closingDoors_takeEvent(short id) {
            int res = RiJStateReactive.TAKE_EVENT_NOT_CONSUMED;
            if(event.isTypeOf(evDoorClosed.evDoorClosed_CargoLiftSystem_id))
                {
                    res = closingDoorsTakeevDoorClosed();
                }
            
            if(res == RiJStateReactive.TAKE_EVENT_NOT_CONSUMED)
                {
                    res = InnerDoorActive_takeEvent(id);
                }
            return res;
        }
        
        //## statechart_method 
        public int doorsClosedTakeevOpenDoors() {
            evOpenDoors params = (evOpenDoors) event;
            int res = RiJStateReactive.TAKE_EVENT_NOT_CONSUMED;
            animInstance().notifyTransitionStarted("1");
            doorsClosed_exit();
            //#[ transition 1 
            itsLift.itsDoorsLock.get(params.floor).gen(new UnlockDoors());
            //#]
            doorsLocked_entDef();
            animInstance().notifyTransitionEnded("1");
            res = RiJStateReactive.TAKE_EVENT_COMPLETE;
            return res;
        }
        
        //## statechart_method 
        public void doorsLocked_enter() {
            animInstance().notifyStateEntered("ROOT.InnerDoorActive.doorsLocked");
            InnerDoorActive_subState = doorsLocked;
            rootState_active = doorsLocked;
            doorsLockedEnter();
        }
        
        //## statechart_method 
        public void doorsLocked_entDef() {
            doorsLocked_enter();
        }
        
        //## statechart_method 
        public int readyToCloseTakeRiJTimeout() {
            int res = RiJStateReactive.TAKE_EVENT_NOT_CONSUMED;
            if(event.getTimeoutId() == InnerDoor_Timeout_readyToClose_id)
                {
                    animInstance().notifyTransitionStarted("7");
                    readyToClose_exit();
                    //#[ transition 7 
                    //itsOuterDoor.get(itsLift.currentFloor).gen(
                    //#]
                    closingDoors_entDef();
                    animInstance().notifyTransitionEnded("7");
                    res = RiJStateReactive.TAKE_EVENT_COMPLETE;
                }
            return res;
        }
        
        //## statechart_method 
        public void rootStateEntDef() {
            InnerDoorActive_entDef();
        }
        
        //## statechart_method 
        public int doorsUnlocked_takeEvent(short id) {
            int res = RiJStateReactive.TAKE_EVENT_NOT_CONSUMED;
            if(event.isTypeOf(evDoorsOpen.evDoorsOpen_CargoLiftSystem_id))
                {
                    res = doorsUnlockedTakeevDoorsOpen();
                }
            
            if(res == RiJStateReactive.TAKE_EVENT_NOT_CONSUMED)
                {
                    res = InnerDoorActive_takeEvent(id);
                }
            return res;
        }
        
        //## statechart_method 
        public int lockingDoorsTakeNull() {
            int res = RiJStateReactive.TAKE_EVENT_NOT_CONSUMED;
            animInstance().notifyTransitionStarted("9");
            lockingDoors_exit();
            doorsClosed_entDef();
            animInstance().notifyTransitionEnded("9");
            res = RiJStateReactive.TAKE_EVENT_COMPLETE;
            return res;
        }
        
        //## statechart_method 
        public int InnerDoorActive_takeEvent(short id) {
            int res = RiJStateReactive.TAKE_EVENT_NOT_CONSUMED;
            return res;
        }
        
        //## statechart_method 
        public void InnerDoorActiveEnter() {
        }
        
        //## statechart_method 
        public int doorsOpenedTakeNull() {
            int res = RiJStateReactive.TAKE_EVENT_NOT_CONSUMED;
            animInstance().notifyTransitionStarted("4");
            doorsOpened_exit();
            readyToClose_entDef();
            animInstance().notifyTransitionEnded("4");
            res = RiJStateReactive.TAKE_EVENT_COMPLETE;
            return res;
        }
        
        //## statechart_method 
        public void doorsUnlocked_enter() {
            animInstance().notifyStateEntered("ROOT.InnerDoorActive.doorsUnlocked");
            InnerDoorActive_subState = doorsUnlocked;
            rootState_active = doorsUnlocked;
            doorsUnlockedEnter();
        }
        
        //## statechart_method 
        public void doorsOpenedExit() {
        }
        
        //## statechart_method 
        public void rootStateExit() {
        }
        
        //## statechart_method 
        public int doorsOpened_takeEvent(short id) {
            int res = RiJStateReactive.TAKE_EVENT_NOT_CONSUMED;
            if(event.isTypeOf(RiJEvent.NULL_EVENT_ID))
                {
                    res = doorsOpenedTakeNull();
                }
            
            if(res == RiJStateReactive.TAKE_EVENT_NOT_CONSUMED)
                {
                    res = InnerDoorActive_takeEvent(id);
                }
            return res;
        }
        
        //## statechart_method 
        public int lockingDoors_takeEvent(short id) {
            int res = RiJStateReactive.TAKE_EVENT_NOT_CONSUMED;
            if(event.isTypeOf(RiJEvent.NULL_EVENT_ID))
                {
                    res = lockingDoorsTakeNull();
                }
            
            if(res == RiJStateReactive.TAKE_EVENT_NOT_CONSUMED)
                {
                    res = InnerDoorActive_takeEvent(id);
                }
            return res;
        }
        
        //## statechart_method 
        public void lockingDoorsEnter() {
        }
        
        //## statechart_method 
        public void readyToCloseExit() {
            itsRiJThread.unschedTimeout(InnerDoor_Timeout_readyToClose_id, this);
        }
        
        //## statechart_method 
        public void readyToCloseEnter() {
            itsRiJThread.schedTimeout(doorsOpenTime, InnerDoor_Timeout_readyToClose_id, this, "ROOT.InnerDoorActive.readyToClose");
        }
        
        //## statechart_method 
        public void InnerDoorActive_exit() {
            switch (InnerDoorActive_subState) {
                case doorsClosed:
                {
                    doorsClosed_exit();
                }
                break;
                case doorsOpened:
                {
                    doorsOpened_exit();
                }
                break;
                case closingDoors:
                {
                    closingDoors_exit();
                }
                break;
                case doorsLocked:
                {
                    doorsLocked_exit();
                }
                break;
                case doorsUnlocked:
                {
                    doorsUnlocked_exit();
                }
                break;
                case readyToClose:
                {
                    readyToClose_exit();
                }
                break;
                case lockingDoors:
                {
                    lockingDoors_exit();
                }
                break;
                default:
                    break;
            }
            InnerDoorActive_subState = RiJNonState;
            InnerDoorActiveExit();
            animInstance().notifyStateExited("ROOT.InnerDoorActive");
        }
        
        //## statechart_method 
        public int closingDoorsTakeevDoorClosed() {
            int res = RiJStateReactive.TAKE_EVENT_NOT_CONSUMED;
            animInstance().notifyTransitionStarted("8");
            closingDoors_exit();
            //#[ transition 8 
            itsLift.itsDoorsLock.get(itsLift.currentFloor).gen(new evLockDoors());
            //#]
            lockingDoors_entDef();
            animInstance().notifyTransitionEnded("8");
            res = RiJStateReactive.TAKE_EVENT_COMPLETE;
            return res;
        }
        
        //## statechart_method 
        public void closingDoorsExit() {
        }
        
        //## statechart_method 
        public void doorsClosedExit() {
        }
        
        //## statechart_method 
        public int doorsLockedTakeevDoorsUnlocked() {
            int res = RiJStateReactive.TAKE_EVENT_NOT_CONSUMED;
            animInstance().notifyTransitionStarted("2");
            doorsLocked_exit();
            //#[ transition 2 
            itsOuterDoor.get(itsLift.currentFloor).gen(new OpenDoors());
            //#]
            doorsUnlocked_entDef();
            animInstance().notifyTransitionEnded("2");
            res = RiJStateReactive.TAKE_EVENT_COMPLETE;
            return res;
        }
        
        //## statechart_method 
        public void doorsLockedEnter() {
        }
        
        //## statechart_method 
        public void doorsOpenedEnter() {
        }
        
        /**  methods added just for design level debugging instrumentation */
        public boolean startBehavior() {
            try {
              animInstance().notifyBehavioralMethodEntered("startBehavior",
                  new ArgData[] {
                   });
              return super.startBehavior();
            }
            finally {
              animInstance().notifyMethodExit();
            }
        }
        public int takeEvent(RiJEvent event) { 
            try { 
              //animInstance().notifyTakeEvent(new AnimEvent(event));
              animInstance().notifyBehavioralMethodEntered("takeEvent",
                  new ArgData[] { new ArgData(RiJEvent.class, "event", event.toString())
                   });
              return super.takeEvent(event); 
            }
            finally { 
              animInstance().notifyMethodExit();
            }
        }
        /**  see com.ibm.rational.rhapsody.animation.AnimatedReactive interface */
        public AnimInstance animInstance() { 
            return InnerDoor.this.animInstance(); 
        }
        
    }
    //#[ ignore
    /**  see com.ibm.rational.rhapsody.animation.Animated interface */
    public AnimClass getAnimClass() { 
        return animClassInnerDoor; 
    }
    /**  see com.ibm.rational.rhapsody.animation.Animated interface */
    public Object getFieldValue(java.lang.reflect.Field f, Object userInstance) { 
         Object obj = null;
         try {
             obj = f.get(userInstance);
         } catch(Exception e) {
              System.err.println("Exception: getting Field value: " + e);
              e.printStackTrace();
         }
         return obj;
    }
    /**  see com.ibm.rational.rhapsody.animation.Animated interface */
    public AnimInstance animInstance() {
        if (animate == null) 
            animate = new Animate(); 
        return animate; 
    } 
    /**  see com.ibm.rational.rhapsody.animation.Animated interface */
    public void addAttributes(AnimAttributes msg) {
        
        msg.add("doorsOpenTime", doorsOpenTime);
    }
    /**  see com.ibm.rational.rhapsody.animation.Animated interface */
    public void addRelations(AnimRelations msg) {
        
        msg.add("itsIDoorsLock", false, true, itsIDoorsLock);
        msg.add("itsLift", false, true, itsLift);
        msg.add("itsOuterDoor", true, false, itsOuterDoor);
    }
    /** An inner class added as instrumentation for animation */
    public class Animate extends AnimInstance { 
        public  Animate() { 
            super(InnerDoor.this); 
        } 
        public void addAttributes(AnimAttributes msg) {
            InnerDoor.this.addAttributes(msg);
        }
        public void addRelations(AnimRelations msg) {
            InnerDoor.this.addRelations(msg);
        }
        
        public void addStates(AnimStates msg) {
            if ((reactive != null) && (reactive.isTerminated() == false))
              reactive.rootState_add(msg);
        }
        
    } 
    //#]
    
}
/*********************************************************************
	File Path	: DefaultComponent/DefaultConfig/CargoLiftSystem/InnerDoor.java
*********************************************************************/

